local hanlie = fk.CreateSkill({
    name = "sj7__hanlie",
    tags = {Skill.Compulsory},
})
  
Fk:loadTranslationTable{
  ["sj7__hanlie"] = "酣烈",
  [":sj7__hanlie"] = "<b>锁定技</b>，你于非濒死状态使用【酒】的效果改为令你本回合使用的下一张伤害牌造成伤害加一。每轮你造成伤害前，你的♠手牌均视为【酒】。",

  ["@@sj7__hanlie-round"] = "酣烈",

  ["$sj7__hanlie1"] = "",
  ["$sj7__hanlie2"] = "",
}

  hanlie:addEffect(fk.PreCardUse, {
    anim_type = "control",
    can_trigger = function(self, event, target, player, data)
      return player:hasSkill(hanlie.name) and target == player and data.card.trueName ~= "slash" and data.card.is_damage_card and player.drank > 0
    end,
    on_use = function(self, event, target, player, data)
      local room = player.room
      data.additionalDamage = (data.additionalDamage or 0) + player.drank
      data.extra_data = data.extra_data or {}
      data.extra_data.drankBuff = player.drank
      player.drank = 0
      room:broadcastProperty(player, "drank")
    end,
  })

  hanlie:addEffect(fk.RoundStart, {
    can_refresh = function(self, event, target, player, data)
      return player:hasSkill(hanlie.name)
    end,
    on_refresh = function(self, event, target, player, data)
      player.room:setPlayerMark(player,"@@sj7__hanlie-round",1)
    end,
  })

  hanlie:addEffect(fk.Damage, {
    can_refresh = function(self, event, target, player, data)
      return player:hasSkill(hanlie.name) and target == player and player:getMark("@@sj7__hanlie-round") > 0
    end,
    on_refresh = function(self, event, target, player, data)
      player.room:setPlayerMark(player,"@@sj7__hanlie-round",0)
    end,
  })

  hanlie:addEffect("filter", {
    card_filter = function(self, card, player)
      return player:hasSkill(hanlie.name) and card.suit == Card.Spade and player:getMark("@@sj7__hanlie-round") > 0
    end,
    view_as = function(self, player, card)
      local c = Fk:cloneCard("analeptic", card.suit, card.number)
      c.skillName = hanlie.name
      return c
    end,
  })

  hanlie.onAcquire = function (self, player, is_start)
    if #player.room.logic:getEventsOfScope(GameEvent.Damage,1,function (e)
      return e.data.from == player
    end,Player.HistoryRound) == 0 then
      player.room:setPlayerMark(player,"@@sj7__hanlie-round",1)
    end
  end

  hanlie.onLose = function (self, player, is_death)
    player.room:setPlayerMark(player,"@@sj7__hanlie-round",0)
  end

  return hanlie